using net_work.Common.Request;
using net_work.Common.Result;
using net_work.Data.DTO.Cou;
using net_work.Data.Entity.Cou;
using net_work.Data.POCO;
using net_work.Data.VO.Cou;

namespace net_work.IService.Cou;

public interface ICourseService
{
    /// <summary>
    /// 分页查询课程
    /// </summary>
    /// <param name="request">查询参数</param>
    /// <returns>分页结果</returns>
    Task<PagedResult<CourseResult>> GetCoursesPagedAsync(PagedRequest request);

    /// <summary>
    /// 根据课程ID查询课程信息
    /// </summary>
    /// <param name="courseId">课程ID</param>
    /// <returns>课程信息</returns>
    Task<Course?> SelectByIdAsync(long courseId);

    /// <summary>
    /// 插入课程
    /// </summary>
    /// <param name="courseAddRequest">新增课程实体</param>
    /// <returns>新增课程ID</returns>
    Task<long> InsertCourse(CourseAddRequest courseAddRequest);

    /// <summary>
    /// 更新课程信息
    /// </summary>
    /// <param name="courseUpdateRequest">更新课程信息</param>
    /// <returns>是否成功</returns>
    Task<int> UpdateCourse(CourseUpdateRequest courseUpdateRequest);

    /// <summary>
    /// 删除课程
    /// </summary>
    /// <param name="ids">课程ID集合</param>
    /// <returns>是否成功</returns>
    Task<int> DeleteCourseByIds(List<long> ids);

    /// <summary>
    /// 导出课程
    /// </summary>
    /// <returns>课程信息</returns>
    public Task<byte[]> ExportCourses();
    
    /// <summary>
    /// 获取课程树形结构
    /// </summary>
    /// <returns>树形结构</returns>
    public Task<List<TreeNode>?> GetCourseTree();
}